package cn.pzhu.java.ch04.collectiondemo;

import java.util.HashSet;
import java.util.Set;

public class SetDemo {

	public static void main(String[] args) {
		Student s1=new Student(1, "zhang3");
		Student s2=new Student(2, "Li4");
		Student s3=new Student(3, "wang5");
		Set<Student> set=new HashSet<Student>();
		set.add(s1);
		set.add(s2);
		set.add(s3);
		set.add(s1);
		set.add(s1);
		set.add(s2);
		//set.get(0);  //unorder
		for(Student s:set){
			System.out.println(s);
		}
		set.remove(s1);
		//set.remove(1);
	}

}
